/**
 * AI Assistant Styles
 * Styling for AI-powered analysis components
 */

/* AI Assistant Response Container */
.ai-assistant-response {
    background: var(--pst-color-background, #ffffff);
    border: 1px solid var(--pst-color-border, #e5e7eb);
    border-left: max(3px, .1875rem, .12em) solid var(--nv-color-green, #76b900);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.15),
        0 10px 10px -5px rgba(0, 0, 0, 0.08);
    animation: fadeInUp 0.3s ease-out;
    font-family: var(--pst-font-family-base, 'NVIDIA', Arial, Helvetica, Sans-Serif);
}

/* AI Assistant Header */
.ai-assistant-header {
    background: var(--pst-color-surface, #f9fafb);
    border-bottom: 1px solid var(--pst-color-border, #e5e7eb);
    color: var(--pst-color-text-base, #374151);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-assistant-icon {
    font-size: 18px;
    animation: pulse 2s infinite;
    color: var(--nv-color-green, #76b900);
}

.ai-assistant-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    color: var(--pst-color-text-base, #374151);
    font-family: var(--pst-font-family-heading, var(--pst-font-family-base, 'NVIDIA', Arial, Helvetica, Sans-Serif));
}

/* AI Status Badges */
.ai-status-badge {
    background: var(--nv-color-green, #76b900);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ai-status-badge-error {
    background: #dc2626;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ai-status-badge-loading {
    background: var(--nv-color-green, #76b900);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: pulse 2s infinite;
}

.ai-provider-badge {
    background: var(--pst-color-surface-200, #f3f4f6);
    color: var(--pst-color-text-muted, #6b7280);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* AI Assistant Content */
.ai-assistant-content {
    padding: 16px 20px;
    line-height: 1.5;
    color: var(--pst-color-text-base, #374151);
    font-family: var(--pst-font-family-base, 'NVIDIA', Arial, Helvetica, Sans-Serif);
    font-size: 14px;
}

.ai-response-text {
    color: var(--pst-color-text-base, #374151);
    line-height: 1.6;
    margin-bottom: 8px;
}

.ai-response-text:last-child {
    margin-bottom: 0;
}

/* AI Response Markdown Styling */
.ai-response-text h1,
.ai-response-text h2,
.ai-response-text h3,
.ai-response-text h4,
.ai-response-text h5,
.ai-response-text h6 {
    color: var(--pst-color-heading, #1f2937);
    font-family: var(--pst-font-family-heading, var(--pst-font-family-base, 'NVIDIA', Arial, Helvetica, Sans-Serif));
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.ai-response-text h1 { font-size: 1.5rem; }
.ai-response-text h2 { font-size: 1.375rem; }
.ai-response-text h3 { font-size: 1.25rem; }
.ai-response-text h4 { font-size: 1.125rem; }
.ai-response-text h5 { font-size: 1rem; }
.ai-response-text h6 { font-size: 0.875rem; }

.ai-response-text p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.ai-response-text ul,
.ai-response-text ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.ai-response-text li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.ai-response-text strong {
    font-weight: 600;
    color: var(--pst-color-text-base, #374151);
}

.ai-response-text em {
    font-style: italic;
}

.ai-response-text code {
    background: var(--pst-color-surface, #f9fafb);
    border: 1px solid var(--pst-color-border, #e5e7eb);
    border-radius: 0.25rem;
    padding: 0.125rem 0.375rem;
    font-family: var(--pst-font-family-monospace, 'Monaco', 'Consolas', monospace);
    font-size: 0.875rem;
    color: var(--pst-color-text-base, #374151);
}

.ai-response-text pre {
    background: var(--pst-color-surface, #f9fafb);
    border: 1px solid var(--pst-color-border, #e5e7eb);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.ai-response-text pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.ai-response-text a {
    color: var(--nv-color-green, #76b900);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.125rem;
}

.ai-response-text a:hover {
    color: var(--nv-color-green-dark, #5a8a00);
    text-decoration-thickness: 2px;
}

/* AI Loading State */
.ai-loading-content {
    color: var(--pst-color-text-muted, #6b7280);
    font-style: italic;
}

.ai-spinner {
    color: var(--nv-color-green, #76b900);
}

/* AI Manual Trigger */
.ai-manual-trigger {
    border-color: var(--nv-color-green, #76b900);
    color: var(--nv-color-green, #76b900);
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
}

.ai-manual-trigger:hover {
    background-color: var(--nv-color-green, #76b900);
    border-color: var(--nv-color-green, #76b900);
    color: white;
}

.ai-manual-content {
    color: var(--pst-color-text-muted, #6b7280);
}

.ai-manual-icon {
    color: var(--nv-color-green, #76b900);
    opacity: 0.7;
}

.ai-manual-text {
    color: var(--pst-color-text-base, #374151);
    font-weight: 500;
}

.ai-manual-subtext {
    color: var(--pst-color-text-muted, #6b7280);
}

/* AI Usage Statistics */
.ai-usage-stats {
    border-top: 1px solid var(--pst-color-border, #e5e7eb);
    padding-top: 1rem;
    margin-top: 1rem;
}

.ai-usage-title {
    color: var(--pst-color-text-muted, #6b7280);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.ai-usage-item {
    background: var(--pst-color-surface, #f9fafb);
    border: 1px solid var(--pst-color-border, #e5e7eb);
    transition: all 0.2s ease;
}

.ai-usage-item:hover {
    background: var(--pst-color-surface-200, #f3f4f6);
    border-color: var(--nv-color-green, #76b900);
}

.ai-usage-number {
    font-size: 1.125rem;
    color: var(--nv-color-green, #76b900);
    font-family: var(--pst-font-family-monospace, 'Monaco', 'Consolas', monospace);
}

.ai-usage-label {
    color: var(--pst-color-text-muted, #6b7280);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* AI Footer */
.ai-assistant-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--pst-color-border, #e5e7eb);
    background: var(--pst-color-surface, #f9fafb);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.ai-disclaimer {
    color: var(--pst-color-text-muted, #6b7280);
    font-size: 12px;
    line-height: 1.4;
    font-style: italic;
}

/* AI Cache Indicator */
.ai-cache-indicator {
    color: var(--pst-color-text-muted, #6b7280);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}



/* AI Error States */
.ai-assistant-error {
    border-left-color: #f59e0b;
}

.ai-assistant-error .ai-assistant-header {
    background: var(--pst-color-surface, #f9fafb);
    border-bottom-color: #f59e0b;
}

.ai-info-icon {
    color: var(--nv-color-green, #76b900);
    font-size: 18px;
}

.ai-error-title {
    color: var(--pst-color-text-base, #374151);
    font-weight: 600;
    margin-bottom: 4px;
}

.ai-error-text {
    color: var(--pst-color-text-muted, #6b7280);
    line-height: 1.4;
}

.ai-error-suggestions {
    color: var(--pst-color-text-muted, #6b7280);
    line-height: 1.4;
}

/* Dark Mode Support */
html[data-theme="dark"] .ai-assistant-response {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #3b82f6;
}

html[data-theme="dark"] .ai-assistant-content {
    color: #e2e8f0;
}

html[data-theme="dark"] .ai-response-text {
    color: #e2e8f0;
}

html[data-theme="dark"] .ai-response-text h1,
html[data-theme="dark"] .ai-response-text h2,
html[data-theme="dark"] .ai-response-text h3,
html[data-theme="dark"] .ai-response-text h4,
html[data-theme="dark"] .ai-response-text h5,
html[data-theme="dark"] .ai-response-text h6 {
    color: #f1f5f9;
}

html[data-theme="dark"] .ai-response-text strong {
    color: #e2e8f0;
}

html[data-theme="dark"] .ai-response-text code {
    background: var(--pst-color-surface, #1e293b);
    border-color: var(--pst-color-border, #334155);
    color: #e2e8f0;
}

html[data-theme="dark"] .ai-response-text pre {
    background: var(--pst-color-surface, #1e293b);
    border-color: var(--pst-color-border, #334155);
}

html[data-theme="dark"] .ai-response-text a {
    color: var(--nv-color-green, #76b900);
}

html[data-theme="dark"] .ai-response-text a:hover {
    color: var(--nv-color-green-light, #8bc34a);
}

html[data-theme="dark"] .ai-assistant-footer {
    border-top-color: #334155;
    background: rgba(30, 41, 59, 0.8);
}

html[data-theme="dark"] .ai-disclaimer {
    color: #94a3b8;
}

html[data-theme="dark"] .ai-cache-indicator {
    color: #94a3b8;
}

html[data-theme="dark"] .ai-usage-item {
    background: var(--pst-color-surface, #1e293b);
    border-color: var(--pst-color-border, #334155);
}

html[data-theme="dark"] .ai-usage-item:hover {
    background: var(--pst-color-surface-200, #374151);
}

html[data-theme="dark"] .ai-usage-number {
    color: var(--nv-color-green, #76b900);
}

html[data-theme="dark"] .ai-usage-label {
    color: #94a3b8;
}

html[data-theme="dark"] .ai-loading-content {
    color: #94a3b8;
}

html[data-theme="dark"] .ai-manual-content {
    color: #94a3b8;
}

html[data-theme="dark"] .ai-manual-text {
    color: #e2e8f0;
}

html[data-theme="dark"] .ai-manual-subtext {
    color: #94a3b8;
}

html[data-theme="dark"] .ai-error-title {
    color: #e2e8f0;
}

html[data-theme="dark"] .ai-error-text,
html[data-theme="dark"] .ai-error-suggestions {
    color: #94a3b8;
}

html[data-theme="dark"] .ai-usage-title {
    color: #94a3b8;
}



/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-assistant-response {
        margin-bottom: 16px;
        border-radius: 12px;
    }
    
    .ai-assistant-header {
        padding: 12px 16px;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .ai-assistant-title {
        font-size: 14px;
    }
    
    .ai-status-badge,
    .ai-status-badge-error,
    .ai-status-badge-loading,
    .ai-provider-badge {
        padding: 2px 4px;
        font-size: 10px;
    }
    
    .ai-assistant-content {
        padding: 16px;
        font-size: 14px;
    }
    
    .ai-assistant-footer {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .ai-disclaimer {
        font-size: 12px;
    }
    
    .ai-usage-stats .row {
        gap: 8px;
    }
    
    .ai-usage-item {
        padding: 8px;
    }
    
    .ai-usage-number {
        font-size: 16px;
    }
    

}

/* Print Styles */
@media print {
    .ai-assistant-response {
        break-inside: avoid;
        border: 1px solid #ccc;
        box-shadow: none;
        background: white !important;
    }
    
    .ai-assistant-header {
        background: #f0f0f0 !important;
        color: #333 !important;
    }
    
    .ai-assistant-icon,
    .ai-assistant-title {
        color: #333 !important;
    }
    
    .ai-status-badge,
    .ai-status-badge-error,
    .ai-status-badge-loading,
    .ai-provider-badge {
        background: #f0f0f0 !important;
        color: #333 !important;
        border: 1px solid #ccc;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .ai-assistant-response {
        border: 3px solid #000;
    }
    
    .ai-assistant-header {
        background: #000 !important;
        color: #f0f0f0;
    }
    
    .ai-usage-number {
        color: #000;
        font-weight: 900;
    }
    
    .ai-status-badge,
    .ai-status-badge-error,
    .ai-status-badge-loading,
    .ai-provider-badge {
        background: #000 !important;
        color: #f0f0f0 !important;
        border: 2px solid #f0f0f0;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .ai-assistant-response,
    .ai-assistant-icon,
    .ai-status-badge-loading,
    .ai-spinner {
        animation: none;
    }
    
    .ai-usage-item,
    .ai-manual-trigger {
        transition: none;
    }
} 